WIDTH = 500
HEIGHT = 500
def queen(s,n,gra):
    for y in range(0,n):
        for x in range(0,n):
            if gra[x][y] == True:
                gra[x][y] = False
                str(x)
                str(y)
                path_l = x,y
                path.append(path_l)
                int(x)
                int(y)
                for i in range(0,n):
                    gra[i][y] = False
                    gra[x][i] = False
                xie(gra,x,y,1,1,n)
                xie(gra,x,y,-1,1,n)
                xie(gra,x,y,-1,-1,n)
                xie(gra,x,y,1,-1,n)
                break
    print(path)
    s += 1
    return s
def xie(gra,x,y,x_j,y_j,n):
    x += x_j
    y += y_j
    if x == n or x == -1:
        return
    if y == n or y == -1:
        return
    if gra[x][y] == True:
        gra[x][y] = False
    xie(gra,x,y,x_j,y_j,n)
def on_key_down(key):
    if key == keys.ESCAPE:
        quit()
        
n = int(input('how many queen:'))
gra = [[True for c in range(0,n)] for j in range(0,n)]
s = 0
path = []
s = queen(s,n,gra)